package uitest
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import iscript.gameFramework.GameLite.events.GameContentEvent;
	import iscript.gameFramework.GameLite.Game;
	import iscript.uiFramework.components.panel.ColorPickerPanel;
	import iscript.uiFramework.components.panel.ScrollPanel;
	import iscript.uiFramework.event.PickColorEvent;
	
	public class ScrollPanelTest extends Sprite
	{
		
		[Embed(source="../../bin/map.jpg")]
		private var map:Class;
		
		[Embed(source="../../bin/7601008.swf",mimeType="application/octet-stream")]
		private var mc:Class
		
		public var basePanel:ScrollPanel = new ScrollPanel();
		
		//public  var basePanel:BasePanel = new BasePanel();
		public function ScrollPanelTest()
		{
			
			var  colour:ColorPickerPanel = new ColorPickerPanel();
			colour.width = 150;
			colour.height = 150;
			colour.addEventListener(PickColorEvent.PICK, function(e:PickColorEvent):void {
			      trace(PickColorEvent(e).hexColor)
				})
				colour.border = true;;
			
			colour.render(this) 
		}
		
		private function toStage(e:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE, toStage);
			Game.Content.addGameContentListener("7601008.swf", install)
			//stage.addEventListener(MouseEvent.CLICK,xxxx)
			//	sp.source = new map()
		}
		
		private function install(e:GameContentEvent):void
		{
			basePanel.source = Game.Content.getSWF("7601008.swf").content;
		}
		
		private function xxxx(e:MouseEvent):void
		{
			//basePanel.VSilderPolicy = false;
			//basePanel.HSilderPolicy = false;
			

			if (basePanel.source != null)
			{
				//	   basePanel.source = Game.Content.getSWF("7601008.swf").content;
			}
		/*else {
		   sp.source = new map();
		   sp.width = 400;
		   sp.height= 400
		 }*/
		}
	
	}

}